-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScheduledTask: Add 'StopExisting' to valid values for MultipleInstances parameter #335
Conversation
…s parameter - fixes Issue dsccommunity#333
The HQRM tests are failing with the error below for all the examples for every resource, saying
|
You should be able to rebase and resolve conflicts and tests should pass. |
I had resolved the conflict in the CHANGELOG.md file. Does anything else need done on this? |
Hi @Rob-S - sorry, this is on me. I'll review this weekend (this week is a bit crazy with MS Build and so none of my evenings are free). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really sorry about the delay in getting this reviewed @Rob-S.
Is it possible to add or update the integration tests to cover this so that we can confirm it will work OK in practice against different OS?
Reviewed 3 of 5 files at r1, 2 of 2 files at r3.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Rob-S)
CHANGELOG.md, line 13 at r3 (raw file):
by changing `CopyDirectories` to `CopyPaths` - Fixes [Issue #332](https://github.com/dsccommunity/ComputerManagementDsc/issues/332). - StartedTask
Can you change this to ScheduledTask?
source/DSCResources/DSC_ScheduledTask/DSC_ScheduledTask.psm1, line 554 at r3 (raw file):
} if ($MultipleInstances -ne 'StopExisting')
Can you add a comment to this code just explaining why it is required? I can see it is covered in the Known Issues, but someone working on this might not see it.
I did try adding a unit test (I took a look at the integration tests, but I'm not really familiar with how those work yet). In the pipeline run, it looks like it's not even trying to run the tests, saying "Cannot bind argument to parameter 'Path' because it is null." although I do see a "Project Path" parameter is set. |
Hi @Rob-S - Sorry, correction, the issue you're seeing is because of the Pester v5.x release. I'm going to pin this module to remain on Pester 4.10.1. |
Once this PR #337 is through you can rebase and the tests will hopefully pass. |
…pleInstances-Parameter-Should-Allow-For-'StopExisting'
@Rob-S - can you try rebasing your branch onto master again to see if that fixes the build? |
Hi @Rob-S - looks like the tests are failing. I think this may be because:https://dev.azure.com/dsccommunity/ComputerManagementDsc/_build/results?buildId=2305&view=logs&j=158455ef-2db5-56fd-6022-83ded799e050&t=b737ddad-5217-50db-260a-b6e0dd548ea1&l=933 |
@PlagueHO Yes, I had fixed the tests around the same time you entered that comment. |
… Set-TargetResource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what we need is a unit test that tests when MultipleInstances
is set to StopExisting
. I could be wrong, but I didn't see one. Is it easy to add that?
Reviewed 1 of 1 files at r5, 1 of 2 files at r7, 1 of 1 files at r9.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Rob-S)
CHANGELOG.md, line 14 at r9 (raw file):
- Pin `Pester` module to 4.10.1 because Pester 5.0 is missing code coverage - Fixes [Issue #336](https://github.com/dsccommunity/ComputerManagementDsc/issues/336).
Can you remove this blank line?
source/DSCResources/DSC_ScheduledTask/DSC_ScheduledTask.psm1, line 1832 at r9 (raw file):
#> $MultipleInstances = [System.String] $settings.MultipleInstances if ([String]::IsNullOrEmpty($MultipleInstances))
Can you change [String]
to [System.String]
?
tests/Unit/DSC_ScheduledTask.Tests.ps1, line 115 at r9 (raw file):
} $scheduledTask = $NULL
Can you change to $null
(lowercase)
No. It's easy to add it for the other values, but not for StopExisting, since the Enum does not support that. See the comments for my commits when I attempted to do that. The issue is that you have to go to the SettingsSet level and if you try to mock that function it fails miserably elsewhere -- the "real" SettingsSet functions must be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Rob-S - let's get this through and I'll see if I can figure out away to abstract the function to increase testability on it. As long as it is not breaking any existing functionality (the existing tests confirm that), then we should be OK. I'll raise another issue to increase coverage on that condition.
Reviewed 3 of 3 files at r10.
Reviewable status: complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved
Pull Request (PR) description
Add 'StopExisting' to valid values for ScheduledTask MultipleInstances parameter - fixes Issue #333
This Pull Request (PR) fixes the following issues
Fixes Issue #333
Task list
Entry should say what was changed, and how that affects users (if applicable).
and comment-based help.
This change is